package cn.lexi.vip.service.http;

import org.apache.http.client.methods.RequestBuilder;

import java.util.Map;

/**
 * @author gaoxiang
 */
public interface IHttpService {

    /**
     * Http Get
     * @param uri
     * @return
     */
    String get(String uri);

    /**
     * Http Get
     * @param uri
     * @param parameters
     * @return
     */
    String get(String uri, Map<String, String> parameters);

    /**
     * Http Get
     * @param uri
     * @param headers
     * @param parameters
     * @return
     */
    String get(String uri, Map<String, String> headers, Map<String, String> parameters);

    /**
     * Http Post
     * @param uri
     * @return
     */
    String post(String uri);

    /**
     * Http Post
     * @param uri
     * @param parameters
     * @return
     */
    String post(String uri, Map<String, String> parameters);

    /**
     * Http Post
     * @param uri
     * @param headers
     * @param parameters
     * @return
     */
    String post(String uri, Map<String, String> headers, Map<String, String> parameters);

    /**
     * setHeader
     * @param requestBuilder
     * @param headers
     */
    void setHeader(RequestBuilder requestBuilder, Map<String, String> headers);

    String doHttp(RequestBuilder requestBuilder, String uri, Map<String, String> headers, Map<String, String> parameters);
}
